// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 职位列表 */
export async function getPositionList(params: API.PageParams) {
  return request('/api/position', {
    method: 'GET',
    params,
  });
}

/** 新增 */
export async function addPosition(data: API.Position.Data) {
  return request('/api/position/add', {
    method: 'POST',
    data,
  });
}

/** 修改 */
export async function updatePosition(data: API.Position.Data) {
  return request('/api/position/update', {
    method: 'POST',
    data,
  });
}

/** 删除 */
export async function deletePosition(id: number) {
  return request('/api/position/delete', {
    method: 'DELETE',
    params: { id },
  });
}

/** 下拉框 */
export async function getSelect(position?: string) {
  return request('/api/position/getSelect', {
    method: 'DELETE',
    params: { position },
  });
}
